<?php
/* @var $this TransferController */
/* @var $model Transfer */
Yii::app()->clientScript->registerScriptFile(Yii::app()->baseUrl . "/global/js/pages/transfer.js"); 
Yii::app()->clientScript->registerScriptFile(Yii::app()->baseUrl . "/global/js/plugins/jquery.validate.js"); 
$this->breadcrumbs=array(
	'元素调动'=>array('index'),
);

?>

<div style="width:900px;">
    <div class="form">
        <table class="c_table" cellspacing="1" cellpadding="1" border="0"> 
         	
            <tr>
                <td width="100"  align="right" class="td-blue">单 号：</td>
                <td> <?php echo $data['transfer']->id ?> </td>
            </tr>
            <tr>
                <td   align="right" class="td-blue">调动人员信息：</td>
                <td> 
                    <table class="c_table">
                         <tr> <td class="td-blue">人员</td> <td class="td-blue">基本信息</td> <td width="300" class="td-blue">职级信息</td></tr>
                        <?php foreach($data['transfer']->user as $v)
                              { 
                              
                              //echo $v->id;
                              ?>
                          <tr> 
                            <td><?php echo $v->c_username ?></td> <td>工号：<?php echo $v->unique_id ?><br />邮箱：<?php echo $v->username ?><br />入职时间：<?php echo $v->entry_point ?></td>
                            <td>属性：<?php echo HrPositionAttribute::getInfoById($v->old_attr_id,'title'); ?><br />L：<?php echo HrPositionLevel::getInfoById($v->old_L,'name'); ?><br />M：<?php echo HrPositionLevel::getInfoById($v->old_M,'name'); ?></td>
                          </tr>
                          <tr>
                            <td>职级是否变动：</td>
                            <td colspan="2">
                        
							<?php if($v->new_attr_id || $v->new_L || $v->new_M) { ?>
                            
                            <div id="new_user_info_<?php echo $v->id; ?>">
                                <table class="c_table_inner">
                                    <tr>
                                        <td  width="70">属性 ：</td>
                                        <td><?php echo HrPositionAttribute::model()->getInfoById($v->new_attr_id,'title'); ?> </td>
                                    </tr>
                                    <tr>
                                        <td>L：</td>
                                        <td><?php echo HrPositionLevel::model()->getInfoById($v->new_L,'name') ?> </td>
                                    </tr>
                                    <tr>
                                        <td>M：</td>
                                        <td><?php echo HrPositionLevel::model()->getInfoById($v->new_M,'name') ?> </td>
                                    </tr>
                                </table>
                            </div>
                            <?php } ?>
                            </td>
                          </tr>
                        <?php }?>
                    </table>
                </td>
                
            </tr>
            
            <tr>
                <td  align="right" class="td-blue">说 明：</td>
                <td>  <?php echo $data['transfer']->note ?> </td>
            </tr>
            <tr>
                <td  align="right" class="td-blue">原 部 门：</td>
                <td> <?php echo $data['transfer']->from_department_name; ?> </td>
            </tr>
            <tr>
                <td  align="right" class="td-blue">新 部 门：</td>
                <td> <?php echo $data['transfer']->to_department_name; ?> </td>
            </tr>
            <tr>
                <td  align="right" class="td-blue">发 起 人：</td>
                <td colspan="3" id=""><?php echo $data['transfer']->start_c_username;?></td>
            </tr>
            <tr>
                <td  align="right" class="td-blue">当前审核人：</td>
                <td colspan="3" id=""> 
                <?php
				echo $data['transfer']->next_c_username;
				?>
                </td>
            </tr>
            <tr>
                <td  align="right" class="td-blue">审核流程：</td>
                <td colspan="3" id=""> 
                <?php
				if(isset($data['transferProcessCUsernames'])) {
					$count = count($data['transferProcessCUsernames']);
					foreach($data['transferProcessCUsernames'] as $k => $v)
					{
						echo $v;	
						if($k < ($count-1))
							echo '<img src="'.Yii::app()->request->baseUrl.'/global/img/icons/arrow_right.gif" />';
					}
				}
				?>
                </td>
            </tr>
            <tr>
                <td  align="right" class="td-blue">生效时间：</td>
                <td colspan="3"> 
                <?php echo date("Y-m-d",$data['transfer']->effective_time); ?>
                </td>
            </tr>
            <tr>
                <td  align="right" class="td-blue" valign="top">流程记录：</td>
                <td colspan="3" id=""> 
                <?php
				if(isset($data['transferIndex'])) {
					foreach($data['transferIndex'] as $v)
					{
						echo $v['c_username'].' '.$v['action_name'].' '.$v['note'].' '.$v['action_time'];
						echo '<br />';
					}
				}
				?>
                </td>
            </tr>
            <tr>
                <td colspan="2" align="center"> 
                	<input type="button" name="r" value=" 关 闭 " class="button_grey" onclick="javascript:if(confirm('确定关闭本页？'))window.close();" />
                </td>
            </tr>
            
        </table>
    </div><!-- form -->
	<br />
</div>